using System.Collections.Generic;
using UnityEngine;

namespace HEFramework
{
    /// <summary>
    /// Trial data,Trial.xlsx
    /// </summary>
    public class DRTrial:IData
    {
        
        /// <summary>
        /// ID  different
        /// </summary>
        public int ID { get; protected set; }
        /// <summary>
        /// 名称   outputKey
        /// </summary>
        public string Name { get; protected set; }
        /// <summary>
        /// 怪物ID组  
        /// </summary>
        public int[] MonsterIDs { get; protected set; }
        /// <summary>
        /// 怪物生成类型  
        /// </summary>
        public int MonsterGenerateType { get; protected set; }
        /// <summary>
        /// 奖励ID组  
        /// </summary>
        public int[] RewardIDs { get; protected set; }
        /// <summary>
        /// 奖励值组  
        /// </summary>
        public int[] RewardValues { get; protected set; }
        /// <summary>
        /// 等待挑战  
        /// </summary>
        public int WaitChallenging { get; protected set; }
        /// <summary>
        /// 冷却  
        /// </summary>
        public int Cooldown { get; protected set; }
        /// <summary>
        /// 下一级  
        /// </summary>
        public int Next { get; protected set; }

        
        public void ParseDataRow(string input)
        {
            string[] text = input.Split('	');
            int index = 0;
        
            ID = int.Parse(text[index++]);
            Name = DataTableExtension.GetStringFromKey(text[index++]);
            MonsterIDs = DataTableExtension.ParseIntArr(text[index++]);
            MonsterGenerateType = int.Parse(text[index++]);
            RewardIDs = DataTableExtension.ParseIntArr(text[index++]);
            RewardValues = DataTableExtension.ParseIntArr(text[index++]);
            WaitChallenging = int.Parse(text[index++]);
            Cooldown = int.Parse(text[index++]);
            Next = int.Parse(text[index++]);

        }
        
        private void AvoidJIT()
        {
            new Dictionary<int, DRTrial>();
        }
    }
}